package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.CommonResult;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @Author : 李红磊
 * @Date : 2021/06/09/15:49
 * @Description :
 */
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin//解决跨域访问
public class EduLoginController {

    @PostMapping("/login")
    public CommonResult myLogin(){
        return CommonResult.ok().data("token","admin");
    }

    @GetMapping("/info")
    public CommonResult myInfo(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("roles","admin");
        map.put("name","admin");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return CommonResult.ok().data(map);
    }

}
